package stream;

import java.math.BigDecimal;
import java.util.Objects;

/**
 * @author : DuJiabao
 * @Date : 2021/3/20 14:49
 * @Project : java_learning
 * @File : null.java
 * @Desc :
 */
public class Employee {
  private int id;
  private BigDecimal salary;
  private String name;

  public Employee() {
  }

  public Employee(int id, BigDecimal salary, String name) {
    this.id = id;
    this.salary = salary;
    this.name = name;
  }

  public int getId() {
    return id;
  }

  public void setId(int id) {
    this.id = id;
  }

  public BigDecimal getSalary() {
    return salary;
  }

  public void setSalary(BigDecimal salary) {
    this.salary = salary;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    Employee employee = (Employee) o;
    return id == employee.id && Objects.equals(salary, employee.salary) && Objects.equals(name, employee.name);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, salary, name);
  }

  @Override
  public String toString() {
    return "Employee{" +
            "id=" + id +
            ", salary=" + salary +
            ", name='" + name + '\'' +
            '}';
  }
}
